package com.easyar.imgbannerwheeltest;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;

import com.alexander.imgbannerwheelview.ImgBannerWheelView;

public class TestFragment extends Fragment
{
    public static final String TAG = "TestFragment";
    private int[] images = new int[]{R.drawable.bg_homebanner_0, R.drawable.bg_homebanner_1, R.drawable.bg_homebanner_2};
    private ImgBannerWheelView imgBannerWheelView;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
    {
        View view = inflater.inflate(R.layout.fragment_test, container, false);
        imgBannerWheelView = view.findViewById(R.id.imgBannerWheelView);
        imgBannerWheelView.setImgs(images);
        return view;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
    {
        super.onViewCreated(view, savedInstanceState);
//        FragmentManager fragmentManager = getChildFragmentManager();
//        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
//        fragmentTransaction.replace(R.id.fragment_Layout, new TestFragment2(), TestFragment2.TAG);
//        fragmentTransaction.commitAllowingStateLoss();
    }
}
